package cglib;

import net.sf.cglib.proxy.Enhancer;

/**
 * @program: jvm
 * @description
 * @author: tkk fendoukaoziji
 * @create: 2019-01-30 14:26
 **/
public class TestCglib  {
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(TestHello.class);//继承被代理类
        enhancer.setCallback(new HelloMethodInterceptor());//设置回调
        TestHello hello = (TestHello)enhancer.create(); //代理类对象
        hello.sayHello();
    }
}
